/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package services;

import java.io.IOException;
import java.io.OutputStream;

/**
 *
 * @author minaev
 */
public class CountOutputStream extends OutputStream{

    OutputStream out;
    int count = 0;

    public CountOutputStream(OutputStream out) {
        this.out = out;
    }
    
    @Override
    public void write(int b) throws IOException {
        count++;
        out.write(b);
    }

    public int getCount() {
        return count;
    }
    
}
